function urival(id) {
	return encodeURI(document.getElementById(id).value);
}
			
function makePOSTRequest(url,parameters, name) {
	http_request = false;
	if (window.XMLHttpRequest) {
		http_request = new XMLHttpRequest();
		if (http_request.overrideMimeType) {
			http_request.overrideMimeType('text/html');
		}
	} else if (window.ActiveXObject){
		  try {
				http_request = new ActiveXObject("Msxml2.XMLHTTP");
		  } catch (e) {
		  	try {
				http_request = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){}
		  }
	}
	
	if (!http_request) {
		alert('Cannot create XMLHTTP instance');
		return false;
	}
	
	http_request.open('POST', url, true);
	http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	http_request.setRequestHeader("Content-length", parameters.length);
	http_request.setRequestHeader("Connection", "close");
	http_request.send(parameters);
	nameval=name;
	http_request.onreadystatechange= alertContents();
}

function alertContents() {
	if (http_request.readyState == 4) {
		if (http_request.status == 200) {
			ajaxrendercomponent(nameval);
		} else {
			alert('There was a problem with the request: ' + http_request.responseText);
		}
	} else {
		setTimeout('alertContents()', 4);
	}
}

